<?php

	class Menu_model extends Model {

		protected $__tbname = 'menu';
		protected $__dbconf = '';

		var $id;	//int(11) unsigned	Primary Key	Auto Increment	NOT NULL
		var $name;	//varchar(64)			NOT NULL
		var $position = 0;	//int(2)			NULL
		var $link;	//varchar(255)			NULL
		var $section;	//varchar(255)			NULL
		var $id_parent = 0;	//int(11)			NULL
		var $type = 0;	//tinyint(1)			NULL
		var $permission;	//varchar(255)			NULL
		var $disabled = 0;	//tinyint(1)			NULL
		var $created_date = CURRENT_TIMESTAMP;	//timestamp			NOT NULL
		var $modified_date;	//datetime			NULL

		protected $__validation_rule = array(
			'id' => array('key' => 'PRI', 'type' => 'int', 'null' => FALSE, 'auto_increment' => TRUE),
			'name' => array('type' => 'varchar', 'size' => 64, 'null' => FALSE),
			'position' => array('type' => 'int', 'null' => TRUE),
			'link' => array('type' => 'varchar', 'size' => 255, 'null' => TRUE),
			'section' => array('type' => 'varchar', 'size' => 255, 'null' => TRUE),
			'id_parent' => array('type' => 'int', 'null' => TRUE),
			'type' => array('type' => 'tinyint', 'null' => TRUE),
			'permission' => array('type' => 'varchar', 'size' => 255, 'null' => TRUE),
			'disabled' => array('type' => 'tinyint', 'null' => TRUE),
			'created_date' => array('type' => 'timestamp', 'null' => FALSE),
			'modified_date' => array('type' => 'datetime', 'null' => TRUE)
		);
	}
